home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 62
/
062.d81
/
dir to var
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
2KB
|
69 lines
230 :
250 rem lines 330, 340 and 350 are
260 rem 'key' lines to be included in
270 rem in any use of dir to var.
280 rem these three lines should be at
290 rem the beginning of your program.
300 :
330 poke147,0:sys57812"dirtovar.o",8,1:sys62631
340 poke55,.:poke56,141:clr:rem lower top of basic
350 dim type$(144),name$(144),le$(144):rem dim these arrays first
360 :
370 printchr$(14)"[147][204]oading directory info..."
380 sys 36096:rem directory-to-variables sub-routine
390 :rem ---------------------------
400 :
410 rem demonstration of one way in
420 rem which the results of dirtovar.o
430 rem can be used.
440 :
450 poke53280,6:poke53281,6:poke646,1
460 po$=""
470 bl$=" "
480 print"[147][213]se [195][210][211][210] [213][208]/[196][207][215][206] and [210][197][212][213][210][206] to select."
500 x=0:fi=1:if na$(1)="" then 860
510 if fi<1 then fi=1
520 if na$(fi)="" then fi=1
530 if fi>138 then fi=138
540 :
550 printpo$
560 :
570 forl=0to6 : i=fi+l
580 if i>144orna$(i)=""thenprinttab(8);bl$:goto620
590 if na$(i+1)=""and(l<x)thenx=l
600 if i=fi+x then print tab(8);"";na$(i);left$(bl$,16-len(na$(i))):goto620
610 printtab(8);na$(i);left$(bl$,16-len(na$(i)))
620 next
630 :
640 get q$:if q$=""then 640
650 if q$<>"[145]"then goto 690
660 if x=0 then fi=fi-1:goto510
670 x=x-1:goto550
680 :
690 if q$<>""then goto 730
700 if x=6 then fi=fi+1:goto520
710 x=x+1:goto550
720 :
730 if q$=chr$(13) then 760
740 goto 640
750 :
760 fi=fi+x
770 print"[147]"tp$"[217]ou chose the filename: "na$(fi)
780 print"[212]his file is of type: "ty$(fi)
790 print"[201]t has a block-length of: "le$(fi)
800 print"[201]ts disk is named: "na$(0)
810 print"[212]he disk [201].[196]. is: "ty$(0)
820 print"[194]locks free on this disk is: "le$(0)
830 print"[208]ress any key to continue."
840 get q$:if q$="" then 840
850 goto 870
860 print"[147]"tp$" [212]here are no files on this disk!":fori=0to2999:next
870 print"[147]"tp$" [195]hoose option:"
880 print" <a> [210]un again"
890 print" <b> [210]eturn to [204][207][193][196][211][212][193][210]"
900 get q$:if q$<"a"orq$>"b"then900
920 if q$="a" then run
930 open 15,8,15,"r0:hello connect=hello connect":input#15,ex,ex$,et,es:close15
940 if ex<>63 then end
950 load "hello connect",8,1